/*带背景的输入布局
* 背景：默认白色
* 背景形状：1.圆角矩形  2.左右圆弧矩形
* */

import 'package:flutter/cupertino.dart';
import 'package:frametrim/utility/sq_color.dart';

//点击事件回调
typedef void onPressCallback(arg);

class InputBackGroundView extends StatefulWidget {
  //背景形状
  late int inputShape;

  late Widget mWidget;

  InputBackGroundView(this.inputShape, this.mWidget);

  @override
  State<StatefulWidget> createState() => InpoutViewState();
}

class InpoutViewState extends State<InputBackGroundView> {
  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(widget.inputShape == 1 ? 5 : 25),
        color: SQColor.white,
      ),
      height: 45,
      margin: EdgeInsets.fromLTRB(28, 0, 28, 0),
      padding: EdgeInsets.fromLTRB(5, 0, 5, 0),
      child: widget.mWidget,
    );
  }
}
